/*
 Navicat Premium Data Transfer

 Source Server         : 127.0.0.1
 Source Server Type    : MySQL
 Source Server Version : 80013
 Source Host           : 127.0.0.1
 Source Database       : db_cli

 Target Server Type    : MySQL
 Target Server Version : 80013
 File Encoding         : utf-8

 Date: 05/01/2020 23:24:49 PM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `t_operate_log`
-- ----------------------------
DROP TABLE IF EXISTS `t_operate_log`;
CREATE TABLE `t_operate_log` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `module` varchar(30) DEFAULT NULL COMMENT '操作模块',
  `type` varchar(30) DEFAULT NULL COMMENT '操作类型',
  `description` varchar(50) DEFAULT NULL COMMENT '操作描述',
  `operator` varchar(30) DEFAULT NULL COMMENT '操作人',
  `ip` varchar(15) DEFAULT NULL COMMENT '客户端IP地址',
  `uri` varchar(100) DEFAULT NULL COMMENT '请求URI',
  `method` varchar(100) DEFAULT NULL COMMENT '方法名称',
  `parameter` varchar(400) DEFAULT NULL COMMENT '请求参数',
  `time` varchar(30) DEFAULT NULL COMMENT '耗时',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=59 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

-- ----------------------------
--  Records of `t_operate_log`
-- ----------------------------
BEGIN;
INSERT INTO `t_operate_log` VALUES ('58', '用户模块', '登录', '使用账号+密码进行登录操作', 'admin', '127.0.0.1', '/login', 'cn.xlbweb.cli.controller.LoginController.login', '{\"password\":\"123456\",\"username\":\"admin\"}', '1毫秒', '2020-05-01 23:22:18', '2020-05-01 23:22:18');
COMMIT;

-- ----------------------------
--  Table structure for `t_permission`
-- ----------------------------
DROP TABLE IF EXISTS `t_permission`;
CREATE TABLE `t_permission` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(20) DEFAULT NULL COMMENT '权限名称',
  `uri` varchar(40) DEFAULT NULL COMMENT 'URI路径',
  `type` int(11) DEFAULT '2' COMMENT '类型 0:目录 1:菜单 2:按钮',
  `parent_id` int(11) DEFAULT NULL COMMENT '父级ID',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='权限表';

-- ----------------------------
--  Records of `t_permission`
-- ----------------------------
BEGIN;
INSERT INTO `t_permission` VALUES ('1', '用户模块', 'user', '0', '0', '2019-09-28 13:07:45', '2019-09-28 13:07:45'), ('2', '查询用户', 'user:listUser', '1', '1', '2020-03-21 21:00:21', '2020-03-21 21:00:21'), ('3', '添加用户', 'user:insertUser', '2', '1', '2020-03-21 12:23:11', '2020-03-21 12:23:11'), ('4', '更新用户', 'user:updateUser', '2', '1', '2019-09-27 21:29:10', '2020-05-01 15:25:57'), ('5', '删除用户', 'user:deleteUser', '2', '1', '2019-09-27 21:29:13', '2020-04-09 21:39:05'), ('6', '角色模块', 'role', '0', '0', '2019-09-28 13:07:48', '2019-09-28 13:07:48'), ('7', '查询角色', 'role:listRole', '1', '6', '2019-09-27 21:29:58', '2019-09-27 21:29:58'), ('8', '添加角色', 'role:insertRole', '2', '6', '2020-03-20 10:33:34', '2020-03-20 10:33:34'), ('9', '更新角色', 'role:updateRole', '2', '6', '2020-03-21 12:23:29', '2020-03-21 12:23:29'), ('10', '删除角色', 'role:deleteRole', '2', '6', '2019-09-27 21:30:03', '2019-09-27 21:30:03'), ('11', '权限模块', 'permission', '0', '0', '2019-09-28 13:07:50', '2019-09-28 13:07:50'), ('12', '查询权限', 'permission:listPermission', '1', '11', '2019-09-27 21:30:06', '2019-09-27 21:30:06'), ('13', '添加权限', 'permission:insertPermission', '2', '11', '2020-03-21 12:23:39', '2020-03-21 12:23:39'), ('14', '更新权限', 'permission:updatePermission', '2', '11', '2019-09-27 21:30:09', '2019-09-27 21:30:09'), ('15', '删除权限', 'permission:deletePermission', '2', '11', '2019-09-27 21:30:11', '2019-09-27 21:30:11');
COMMIT;

-- ----------------------------
--  Table structure for `t_role`
-- ----------------------------
DROP TABLE IF EXISTS `t_role`;
CREATE TABLE `t_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `name` varchar(20) DEFAULT NULL COMMENT '角色名称',
  `remarks` varchar(30) DEFAULT NULL COMMENT '备注',
  `status` int(11) DEFAULT '1' COMMENT '状态 0:启用 1:停用',
  `create_by` varchar(18) DEFAULT NULL COMMENT '创建者',
  `update_by` varchar(18) DEFAULT NULL COMMENT '更新者',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色表';

-- ----------------------------
--  Records of `t_role`
-- ----------------------------
BEGIN;
INSERT INTO `t_role` VALUES ('1', 'ADMIN', '超级管理员', '1', '1', '1', '2020-05-01 15:20:57', '2020-05-01 15:21:40'), ('2', 'TEACHER', '教师', '1', '1', '1', '2020-05-01 15:22:17', '2020-05-01 15:22:22'), ('3', 'STUDENT', '学生', '1', '1', '1', '2020-05-01 15:22:38', '2020-05-01 15:22:41');
COMMIT;

-- ----------------------------
--  Table structure for `t_role_permission`
-- ----------------------------
DROP TABLE IF EXISTS `t_role_permission`;
CREATE TABLE `t_role_permission` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `role_id` int(11) DEFAULT NULL COMMENT '角色ID',
  `permission_id` int(11) DEFAULT NULL COMMENT '权限ID',
  `remarks` varchar(30) DEFAULT NULL COMMENT '备注',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=97 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='角色权限中间表';

-- ----------------------------
--  Records of `t_role_permission`
-- ----------------------------
BEGIN;
INSERT INTO `t_role_permission` VALUES ('74', '2', '2', 'TEACHER-查询用户', '2020-03-21 20:57:12', null), ('75', '2', '3', 'TEACHER-添加用户', '2020-03-21 20:57:12', null), ('76', '2', '18', 'TEACHER-添加&更新用户', '2020-03-21 20:57:12', null), ('77', '2', '23', 'TEACHER-赋权', '2020-03-21 20:57:12', null), ('87', '3', '2', 'STUDENT-查询用户', '2020-03-21 21:04:08', null), ('88', '1', '2', 'ADMIN-查询用户', '2020-03-21 21:08:15', null), ('89', '1', '7', 'ADMIN-查询角色', '2020-03-21 21:08:15', null), ('90', '1', '10', 'ADMIN-删除角色', '2020-03-21 21:08:15', null), ('91', '1', '19', 'ADMIN-添加&更新角色', '2020-03-21 21:08:15', null), ('92', '1', '22', 'ADMIN-查询权限树', '2020-03-21 21:08:15', null), ('93', '1', '12', 'ADMIN-查询权限', '2020-03-21 21:08:15', null), ('94', '1', '15', 'ADMIN-删除权限', '2020-03-21 21:08:15', null), ('95', '1', '16', 'ADMIN-添加&更新权限', '2020-03-21 21:08:15', null), ('96', '1', '4', 'ADMIN-删除用户', '2020-04-09 21:40:24', '2020-04-09 21:44:06');
COMMIT;

-- ----------------------------
--  Table structure for `t_user`
-- ----------------------------
DROP TABLE IF EXISTS `t_user`;
CREATE TABLE `t_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `username` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '账号',
  `password` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '密码',
  `nickname` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '昵称',
  `avatar` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '头像',
  `phone` varchar(11) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '手机',
  `email` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL COMMENT '邮箱',
  `sex` int(11) DEFAULT '0' COMMENT '性别 0:男 1:女',
  `age` int(11) DEFAULT NULL COMMENT '年龄',
  `status` int(11) DEFAULT '1' COMMENT '状态 0:正常 1:禁用 2:删除',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='用户表';

-- ----------------------------
--  Records of `t_user`
-- ----------------------------
BEGIN;
INSERT INTO `t_user` VALUES ('1', 'admin', '038bdaf98f2037b31f1e75b5b4c9b26e', '超级管理', 'http://ok-admin.xlbweb.cn/images/avatar.png', '13222222222', 'admin@qq.com', '1', '21', '0', '2018-11-28 10:00:11', '2020-04-11 12:06:25'), ('2', 'zhangsan', '2a0d136ceacafe198ea64ac09daaf1b6', '我是张三', 'https://thirdqq.qlogo.cn/qqapp/101235792/F2407217C117BC8E13904E221D393FDC/100', '13333333333', 'zhangsan@qq.com', '1', '18', '0', '2018-11-13 15:17:22', '2020-05-01 16:30:33'), ('3', 'lisi', '8c702ae443795331c91cfab48f3f3833', '我是李四', 'https://thirdqq.qlogo.cn/qqapp/101235792/F2407217C117BC8E13904E221D393FDC/100', '13222222222', 'lisi@qq.com', '1', '22', '0', '2018-11-28 10:00:13', '2020-05-01 16:39:46'), ('4', 'wangwu', '1a1c20f725621237a8620b7287987623', '我是王五', 'https://thirdqq.qlogo.cn/qqapp/101235792/F2407217C117BC8E13904E221D393FDC/100', '13222222222', 'wangwu@qq.com', '0', '23', '0', '2018-11-28 10:00:15', '2020-05-01 16:44:54'), ('5', 'zhaoliu', '0f72c970f27521bf407731a902034907', '我是周六', 'https://thirdqq.qlogo.cn/qqapp/101235792/F2407217C117BC8E13904E221D393FDC/100', '13222222222', 'zhaoliu@qq.com', '1', '19', '1', '2018-11-28 10:00:17', '2020-05-01 22:26:09'), ('6', 'songqi', 'f706585609a1e388524e88c0d4038268', '我是宋七', 'https://thirdqq.qlogo.cn/qqapp/101235792/F2407217C117BC8E13904E221D393FDC/100', '13222222222', 'songqi@qq.com', '0', '28', '1', '2018-11-28 10:00:19', '2020-05-01 22:25:59'), ('7', 'ceshi1', '123456', '我是测试1', 'https://q.qlogo.cn/qqapp/101235792/73EE253B488FB6033AD6A164362F26E6/100', '13222222222', '43@cc.cc', '0', '25', '2', '2018-11-28 10:00:20', '2020-05-01 16:30:43'), ('8', 'ceshi2', '123456', '我是测试2', 'https://q.qlogo.cn/qqapp/101235792/73EE253B488FB6033AD6A164362F26E6/100', '13222222222', '4321@qq.cc', '1', '26', '2', '2018-11-28 10:00:22', '2020-05-01 16:29:45');
COMMIT;

-- ----------------------------
--  Table structure for `t_user_role`
-- ----------------------------
DROP TABLE IF EXISTS `t_user_role`;
CREATE TABLE `t_user_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
  `user_id` int(11) DEFAULT NULL COMMENT '用户ID',
  `role_id` int(11) DEFAULT NULL COMMENT '角色ID',
  `remarks` varchar(30) DEFAULT NULL COMMENT '备注',
  `create_time` datetime DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `update_time` datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='用户角色中间表';

-- ----------------------------
--  Records of `t_user_role`
-- ----------------------------
BEGIN;
INSERT INTO `t_user_role` VALUES ('1', '2', '2', 'zhangsan-TEACHER', '2019-09-27 17:32:31', '2020-05-01 15:29:01'), ('2', '3', '3', 'lisi-STUDENT', '2019-09-27 17:32:27', '2020-05-01 15:29:04'), ('3', '4', '3', 'wangwu-STUDENT', '2019-09-27 17:32:29', '2020-05-01 15:29:07'), ('4', '10', '2', '2-TEACHER', '2020-03-22 12:47:02', '2020-05-01 15:29:10'), ('5', '10', '1', '2-ADMIN', '2020-03-22 12:47:02', '2020-05-01 15:29:13'), ('6', '8', '2', 'ceshi2-TEACHER', '2020-04-09 21:45:38', '2020-05-01 15:29:16'), ('7', '8', '3', 'ceshi2-STUDENT', '2020-04-09 21:45:38', '2020-05-01 15:29:19');
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
